<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Nufashion</title>
        <link href="../css/main.css" type="text/css" rel="stylesheet"/>
        <script src="../js/jquery-1.6.4.min.js" type="text/javascript"></script>
        <script src="../js/jquery.bxSlider.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function(){
                $('#banner').bxSlider({
                    auto: true,
                    displaySlideQty: 3,
                    moveSlideQty: 1,
                    nextImage: '../img/layout/scroll right3732.png',
                    prevImage: '../img/layout/scroll left3732.png'
                });
            });	
        </script>
    </head>
    <body>
        <div class="wrapper">
            <?php include("header.php"); ?>
            <div class="banner-wrapper">
                <div class="banner" id="banner">
                    <?php
                         include_once '../service/bannerService.php';
                        $banners = getAllBanner();
                        while ($banner = mysql_fetch_array($banners)) {
                            $link = "";
                            if ($banner['PRO_ID'] != "") {
                                $link = "detail.php?id=" . $banner['PRO_ID'];
                            }
                    ?>
                        <div><a href="<?php echo($link);?>"><img src="<?php echo($banner['BANNER_PATH'])?>" width="246" height="421"/></a></div>
                    <?php
                        }
                    ?>
<!--                    <div><a href="#"><img src="../img/banner/Banner Left.png" width="246" height="421"/></a></div>
                    <div><a href="#"><img src="../img/banner/Banner middle.png" width="246" height="421"/></a></div>
                    <div><a href="#"><img src="../img/banner/Banner right.png" width="246" height="421"/></a></div>
                    <div><a href="#"><img src="../img/banner/ADSC_0240.jpg" width="246" height="421"/></a></div>
                    <div><a href="#"><img src="../img/banner/aDSC_0243.jpg" width="246" height="421"/></a></div>-->
                </div>
            </div>

            <div class="main-body banner-space">
                <?php include("left_menu.php"); ?>
                <div class="main-body-right">
                    <div class="top-thumbnail thick-margin">

                        <?php
                        include_once '../service/productService.php';
                        include_once '../service/imageService.php';
                        $products = getTopProduct();
                        while ($product = mysql_fetch_array($products)) {
                            $image = getMainImageByProID($product['PRO_ID']);
                            if ($image['IMG_PATH'] == '') {
                                $thumbnailPath = "../img/layout/no-image.png";
                            } else {
                                $thumbnailPath = "../img/product/thumbnail/" . $image['IMG_PATH'];
                            }
                            ?>
                            <div class="product-container">
                                <div>
                                    <?php
                                    if ($product['PRO_STATUS'] == 2) {
                                        echo'<img src="../img/layout/new-Button.png" width="50" height="48" style="position: absolute;"/>';
                                    } else if ($product['PRO_STATUS'] == 5) {
                                        echo'<img src="../img/layout/sale.png" width="50" height="48" style="position: absolute;"/>';
                                    }
                                    ?>
                                    <a href="detail.php?id=<?php echo($product['PRO_ID']); ?>"><img src="<?php echo($thumbnailPath); ?>" width="178"  height="222"/></a>
                                </div>
                                <div class="product-text"><a href="detail.php?id=<?php echo($product['PRO_ID']); ?>"><?php echo($product['PRO_NAME']); ?></a></div>
                            </div>
                            <?php
                        }
                        ?>


                    </div>
                    <!--                    <div class="middle-banner">
                                            <a href="#"><img src="../img/layout/Model-Down.jpg" width="320" height="455"/></a>
                                            <a href="#"><img src="../img/layout/Model-Down-left.jpg" width="320" height="455"/></a>
                                        </div>-->
                </div>
            </div>
            <?php include("footer.php"); ?>
        </div>
    </body>
</html>
